<?php

/**
 * Home actions.
 *
 * @package    iceblog
 * @subpackage Home
 * @author     Jonathan Olger Nieto Lajo <ice_j7@hotmail.com>
 */
class HomeActions extends ActionsProject
{
  public function executeShow(sfWebRequest $request)
  {
    /*if (!$request->getParameter('sf_culture'))
    {
      if ($this->getUser()->isFirstRequest())
      {
        $culture = $request->getPreferredCulture(array('en', 'es'));
        $this->getUser()->setCulture($culture);
        $this->getUser()->isFirstRequest(false);
      }
      else
      {
        $culture = $this->getUser()->getCulture();
      }
      
      $this->redirect('localized_homepage');
    }*/
    
    /*
    $code = '
    
    class sfDoctrineCollectionExt extends Doctrine_Collection
    {
      public function removeRecord(DoctrineRecord $record)
      {
        $this->remove($this->search($record));
      }
      public function restoreRemoved()
      {
        foreach ($this->getDeleteDiff() as $record)
        {
          $this->add($record);
        }
      }
    }
    ';
    
    $geshi = new GeSHi($code, 'php');
    $geshi->set_header_type(GESHI_HEADER_PRE_VALID);
    $geshi->enable_classes();
    
    Deb::print_r($geshi->parse_code());
    
    */
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    Doctrine::getTable('Visit')->createAndSave($request->getPathInfoArray());
    
    $this->posts = Doctrine::getTable('Post')->findLastPosts(100);
  }
  
  public function executeAbout(sfWebRequest $request)
  {
  }
}
